Skip to content

CLASTR WIP #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 30 commits into from
May 30, 2024
Merged

CLASTR WIP #24

merged 30 commits into from
May 30, 2024

Conversation

j-andrews7
Copy link
Owner

This is just so we have a place to discuss any issues that may arise. Ideally, we'd be able to get this working for the batch query as well, though I foresee an even larger parsing nightmare on that front.

@MikeWLloyd
Copy link
Collaborator

I've worked on the batch API results a bit. It isn't as complex as feared, in that it only adds a level to the return array. It seems to be possible to use the existing parsing code (or derivation of it) and apply that to each batch query result.

@MikeWLloyd
Copy link
Collaborator

Or, we just save the xlsx return:

    r = requests.post(url, data=json.dumps(query))

    try:
        r.raise_for_status()
    except requests.exceptions.HTTPError as e:
        return pd.DataFrame({"Error": [str(e)]})

    with open('testing.xlsx', 'wb') as fd:
        for chunk in r.iter_content(chunk_size=128):
            fd.write(chunk)

@j-andrews7
Copy link
Owner Author

Another thought on this is that currently we have a fix whereby "Penta D" or "Penta_E" are forced to "PentaD", etc. And it seems like it may be better to go the other way, e.g. force "PentaD" or "Penta_E" to "Penta D" and "Penta E" depending on what the API expects. Presumably it requires %20 as the space in the URL for those markers.

@MikeWLloyd
Copy link
Collaborator

Another thought on this is that currently we have a fix whereby "Penta D" or "Penta_E" are forced to "PentaD", etc. And it seems like it may be better to go the other way, e.g. force "PentaD" or "Penta_E" to "Penta D" and "Penta E" depending on what the API expects. Presumably it requires %20 as the space in the URL for those markers.

I failed to consider this. The API expects: "Penta D": "".

This consideration highlights another point I've been thinking about: if a custom DB with malformed maker names (with respect to the API) is uploaded, or a batch file with malformed marker names is used, the API query will return nothing. I am thinking of adding a check prior to the API post request and throwing a warning/error message when non-compatible marker names are found. I could see someone having a mix of compatible and non-compatible markers and still wishing to query.

@MikeWLloyd
Copy link
Collaborator

MikeWLloyd commented May 21, 2024

Remaining to resolve:

Other things I am missing?

@j-andrews7 j-andrews7 marked this pull request as ready for review May 30, 2024 18:03
@j-andrews7 j-andrews7 merged commit 845cca2 into dev May 30, 2024
5 of 10 checks passed
@j-andrews7 j-andrews7 deleted the clastr branch September 30, 2024 02:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants